//
//  SleeveCollectionViewCell.m
//  WhereToTravel
//
//  Created by dlios on 15/10/16.
//  Copyright © 2015年 zhoushengmin. All rights reserved.
//

#import "SleeveCollectionViewCell.h"

#define W self.contentView.frame.size.width
#define H self.contentView.frame.size.height

@implementation SleeveCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.upImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.upImageView];
    
    self.backView = [[UIView alloc] init];
    [self.contentView addSubview:self.backView];
    self.backView.backgroundColor = [UIColor whiteColor];
    
    self.mistLabel = [[UILabel alloc] init];
    [self.backView addSubview:self.mistLabel];
    self.mistLabel.numberOfLines = 0;
    self.mistLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
    
    self.downLabel = [[UILabel alloc] init];
    [self.backView addSubview:self.downLabel];
    self.downLabel.font = [UIFont systemFontOfSize:12];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.upImageView.frame = CGRectMake(W * 0.1, 0, W * 0.8, H * 0.7);
    self.backView.frame = CGRectMake(W * 0.1, H * 0.7, W * 0.8, H * 0.3);
    self.mistLabel.frame = CGRectMake(W * 0.1, H * 0.05, W * 0.8, H * 0.15);
    self.downLabel.frame = CGRectMake(W * 0.1, H * 0.2, W * 0.8, H * 0.1);
}


@end
